package shipping.api;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import shipping.model.ShippingConfig;
import utils.sql.GenericSpecification;

import java.util.Map;

/**
 * 物流配置相关API
 * Created by Liang Wenxu on 2017-03-16.
 */
public interface ShippingConfigApi {
    /**
     * 根据快递公司名称获取物流配置
     * @param name
     * @return
     */
    public ShippingConfig findByName(String name);

    /**
     * 根据配置获取
     * @param id
     * @return
     */
    public ShippingConfig findById(String id);

    /**
     * 根据Example查找
     * @param example
     * @param pageable
     * @return
     */
    public Page<ShippingConfig> findByExamplePaged(ShippingConfig example, Pageable pageable);

    /**
     * 根据Specification查找
     * @param specification
     * @param pageable
     * @return
     */
    public Page<ShippingConfig> findBySpecificationPaged(ShippingConfig specification, Pageable pageable);

    public Map<String, String> findAllConfigMapping();
}
